package io.gitee.thinkbungee.mongo.controller;

import io.gitee.thinkbungee.crud.mongo.controller.SatelliteMongoBaseController;
import io.gitee.thinkbungee.crud.mongo.service.SatelliteMongoBaseService;
import io.gitee.thinkbungee.mongo.controller.dto.UsernameDto;
import io.gitee.thinkbungee.mongo.controller.param.UsernameParam;
import io.gitee.thinkbungee.mongo.entity.UsernameEntity;
import io.gitee.thinkbungee.mongo.service.UsernameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 提供增删改查方法:
 * 新增:               post        /
 * 查询列表(带参数参数):  get         /pageList
 * 删除:               delete      /{id}
 * 根据ids批量删除:      post        /delete/batch
 * 根据id查询:          get         /{id}
 * 根据id更新:          put         /
 *
 * @author chenyichang
 * @email 820117089@qq.com
 * @date 2022-05-26 17:17:25
 */
@RestController
@RequestMapping("mongo/username")
public class UsernameController extends SatelliteMongoBaseController<UsernameParam, UsernameEntity, UsernameDto> {

    @Autowired
    private UsernameService usernameService;

    @Override
    public SatelliteMongoBaseService<UsernameParam, UsernameEntity> getService() {
        return usernameService;
    }

    @Override
    public UsernameEntity getEntity() {
        return new UsernameEntity();
    }

    @Override
    public UsernameDto getDTO() {
        return new UsernameDto();
    }
}
